package 华为练习3;

import java.util.Scanner;

/**
 * Created by hest0 on 2017/7/14.
 */
public class 密码强度等级 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String line = sc.nextLine();
            System.out.println(func(line));
        }
        sc.close();
    }

    private static String func(String s) {
        int score = len2Score(s) + alp2Score(s) + dig2Score(s) + sig2Score(s) + reward(s);
        if (score >= 90)
            return "VERY_SECURE";
        else if (score >= 80)
            return "SECURE";
        else if (score >= 70)
            return "VERY_STRONG";
        else if (score >= 60)
            return "STRONG";
        else if (score >= 50)
            return "AVERAGE";
        else if (score >= 25)
            return "WEAK";
        else if (score >= 0)
            return "VERY_WEAK";
        return null;
    }

    private static int reward(String s) {
        int[] a = count(s);
        int len = s.length();
        int upCase = a[1];
        int lowCase = a[2];
        int digNum = a[3];
        int sigNum = a[4];
        int alpNum = a[1] + a[2];

        if (upCase != 0 && lowCase != 0 && digNum != 0 && sigNum != 0)
            return 5;
        else if ((upCase == 0 && lowCase != 0 && digNum != 0 && sigNum != 0) || (upCase != 0 && lowCase == 0 && digNum != 0 && sigNum != 0))
            return 3;
        else if (alpNum != 0 && digNum != 0 && sigNum == 0)
            return 2;
        return 0;
    }

    private static int[] count(String s) {
        char[] c = s.toCharArray();
        int len = s.length();
        int upCase = 0;
        int lowCase = 0;
        int digNum = 0;
        int sigNum = 0;
        for (int i = 0; i < c.length; i++) {
            String cs = String.valueOf(c[i]);
            if (Character.isUpperCase(c[i]))
                upCase++;
            else if (Character.isLowerCase(c[i]))
                lowCase++;
            else if (Character.isDigit(c[i]))
                digNum++;
            else if (cs.matches("[\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E]+"))
                sigNum++;
        }
        return new int[]{len, upCase, lowCase, digNum, sigNum};
    }

    private static int sig2Score(String s) {
        int[] a = count(s);
        int sigNum = a[4];
        if (sigNum == 0)
            return 0;
        else if (sigNum == 1)
            return 10;
        else if (sigNum > 1)
            return 25;
        return 0;
    }

    private static int dig2Score(String s) {
        int[] a = count(s);
        int digNum = a[3];
        if (digNum == 0)
            return 0;
        else if (digNum == 1)
            return 10;
        else if (digNum > 1)
            return 20;
        return 0;
    }

    private static int alp2Score(String s) {
        int[] a = count(s);
        int upCase = a[1];
        int lowCase = a[2];
        if (upCase + lowCase == 0)
            return 0;
        else if (upCase == s.length() || lowCase == s.length())
            return 10;
        else if (upCase != 0 && lowCase != 0)
            return 20;
        return 0;
    }

    private static int len2Score(String s) {
        if (s.length() <= 4)
            return 5;
        else if (s.length() >= 8)
            return 25;
        else
            return 10;
    }
}
